package com.boc.langxiang.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.boc.langxiang.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by admin on 2016/6/23.
 */
public class MeViewItem extends LinearLayout {

    private static final String NAMESPACE = "http://schemas.android.com/apk/res-auto";
    @BindView(R.id.tv_view_item_me)
    TextView tvViewItemMe;
    private String mContent = "";

    public MeViewItem(Context context) {
        super(context);
        initRes();
    }

    private void initRes() {
        View view = View.inflate(getContext(), R.layout.view_item_me, this);
        ButterKnife.bind(this);
        tvViewItemMe.setText(mContent);

    }

    public MeViewItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContent = attrs.getAttributeValue(NAMESPACE, "content");
        initRes();
    }

    public MeViewItem(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initRes();
    }

    public void setContent(String content){
        tvViewItemMe.setText(content);
    }
}
